O player não consegue usar o objeto "you cannot use this object." 21:48 You can't fish yet.
Gostaria de saber como "renovar" deixar o player sem essa msg de erro!
Erro!
[31/01/2013 18:38:17] [Error - Action Interface]
[31/01/2013 18:38:17] In a timer event called from:
[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:onUse
[31/01/2013 18:38:17] Description:
[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:104: attempt to index field '?' (a nil value)
[31/01/2013 18:38:17] stack traceback:
[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:104: in function <data/actions/scripts/tools/fishing.lua:91>
Segue meu fishing.lua
local condition = createConditionObject(CONDITION_INFIGHT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 60000)
function onUse(cid, item, fromPos, itemEx, toPos)
if getTilePzInfo(getCreaturePosition(cid)) == true then
return doPlayerSendCancel(cid, 'You cannot fish in protection zone')
end
doAddCondition(cid, condition)
d0 =
{
[0] = {pokemon = 'Magikarp'},
}
d20 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Horsea'},
[2] = {pokemon = 'Poliwag'},
[3] = {pokemon = 'Krabby'},
}
d40 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Horsea'},
[2] = {pokemon = 'Poliwag'},
[3] = {pokemon = 'Goldeen'},
[4] = {pokemon = 'Krabby'},
[5] = {pokemon = 'Tentacool'},
}
d60 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Horsea'},
[2] = {pokemon = 'Poliwag'},
[3] = {pokemon = 'Goldeen'},
[4] = {pokemon = 'Krabby'},
[5] = {pokemon = 'Tentacool'},
[6] = {pokemon = 'Seaking'},
}
d80 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Horsea'},
[2] = {pokemon = 'Poliwag'},
[3] = {pokemon = 'Goldeen'},
[4] = {pokemon = 'Krabby'},
[5] = {pokemon = 'Tentacool'},
[6] = {pokemon = 'Seaking'},
[7] = {pokemon = 'Starmie'},
[8] = {pokemon = 'Kingler'},
[9] = {pokemon = 'Seadra'},
}
d100 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Horsea'},
[2] = {pokemon = 'Poliwag'},
[3] = {pokemon = 'Goldeen'},
[4] = {pokemon = 'Krabby'},
[5] = {pokemon = 'Tentacool'},
[6] = {pokemon = 'Seaking'},
[7] = {pokemon = 'Starmie'},
[8] = {pokemon = 'Kingler'},
[9] = {pokemon = 'Seadra'},
[10] = {pokemon = 'Starmie'},
[11] = {pokemon = 'Kingler'},
[12] = {pokemon = 'Seadra'},
}
local config = {
waters = {4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825},
}
if (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) and not canFishWhileSurfingOrFlying then
doPlayerSendCancel(cid, "You can't fish while surfing/flying.")
return true
end
local skill = getPlayerSkillLevel(cid, 6)
local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}
function Effect()
doSendMagicEffect(toPos, 2)
end
function Say()
if skill >= 0 and skill < 20 then
local random = math.random(0, 0)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d0[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 20 and skill < 40 then
local random = math.random(0, 4)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d20[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 40 and skill < 60 then
local random = math.random(0, 5)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d40[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 60 and skill < 80 then
local random = math.random(0, 6)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d60[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 80 and skill < 100 then
local random = math.random(0, 9)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d80[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 100 then
local random = math.random(0, 12)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d100[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
end
end
if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) >= 1 then
doPlayerSendTextMessage(cid, 27, "You can't fish yet.")
return false
end
if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) <= 0 then
setPlayerStorageValue(cid, 171833, 1)
doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)
doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)
for i = 1,3 do
addEvent(Effect,750*i,cid)
end
addEvent(Say,3000)
return true
end
return true
end
e.e amigo veja se no actions.xml esta a ID do item certo! ou sua vara esteja configurada no dat editor como Usavel!







info
Grupo: Artesão
Registrado: 27/04/11
Posts: 112
Reputação: +2
O player não consegue usar o objeto "you cannot use this object." 21:48 You can't fish yet.
Gostaria de saber como "renovar" deixar o player sem essa msg de erro!
Erro!
[31/01/2013 18:38:17] [Error - Action Interface]
[31/01/2013 18:38:17] In a timer event called from:
[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:onUse
[31/01/2013 18:38:17] Description:
[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:104: attempt to index field '?' (a nil value)
[31/01/2013 18:38:17] stack traceback:
[31/01/2013 18:38:17] data/actions/scripts/tools/fishing.lua:104: in function <data/actions/scripts/tools/fishing.lua:91>
Segue meu fishing.lua
local condition = createConditionObject(CONDITION_INFIGHT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 60000)
function onUse(cid, item, fromPos, itemEx, toPos)
if getTilePzInfo(getCreaturePosition(cid)) == true then
return doPlayerSendCancel(cid, 'You cannot fish in protection zone')
end
doAddCondition(cid, condition)
d0 =
{
[0] = {pokemon = 'Magikarp'},
}
d20 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Horsea'},
[2] = {pokemon = 'Poliwag'},
[3] = {pokemon = 'Krabby'},
}
d40 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Horsea'},
[2] = {pokemon = 'Poliwag'},
[3] = {pokemon = 'Goldeen'},
[4] = {pokemon = 'Krabby'},
[5] = {pokemon = 'Tentacool'},
}
d60 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Horsea'},
[2] = {pokemon = 'Poliwag'},
[3] = {pokemon = 'Goldeen'},
[4] = {pokemon = 'Krabby'},
[5] = {pokemon = 'Tentacool'},
[6] = {pokemon = 'Seaking'},
}
d80 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Horsea'},
[2] = {pokemon = 'Poliwag'},
[3] = {pokemon = 'Goldeen'},
[4] = {pokemon = 'Krabby'},
[5] = {pokemon = 'Tentacool'},
[6] = {pokemon = 'Seaking'},
[7] = {pokemon = 'Starmie'},
[8] = {pokemon = 'Kingler'},
[9] = {pokemon = 'Seadra'},
}
d100 =
{
[0] = {pokemon = 'Magikarp'},
[1] = {pokemon = 'Horsea'},
[2] = {pokemon = 'Poliwag'},
[3] = {pokemon = 'Goldeen'},
[4] = {pokemon = 'Krabby'},
[5] = {pokemon = 'Tentacool'},
[6] = {pokemon = 'Seaking'},
[7] = {pokemon = 'Starmie'},
[8] = {pokemon = 'Kingler'},
[9] = {pokemon = 'Seadra'},
[10] = {pokemon = 'Starmie'},
[11] = {pokemon = 'Kingler'},
[12] = {pokemon = 'Seadra'},
}
local config = {
waters = {4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825},
}
if (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) and not canFishWhileSurfingOrFlying then
doPlayerSendCancel(cid, "You can't fish while surfing/flying.")
return true
end
local skill = getPlayerSkillLevel(cid, 6)
local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}
function Effect()
doSendMagicEffect(toPos, 2)
end
function Say()
if skill >= 0 and skill < 20 then
local random = math.random(0, 0)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d0[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 20 and skill < 40 then
local random = math.random(0, 4)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d20[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 40 and skill < 60 then
local random = math.random(0, 5)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d40[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 60 and skill < 80 then
local random = math.random(0, 6)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d60[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 80 and skill < 100 then
local random = math.random(0, 9)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d80[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
elseif skill >= 100 then
local random = math.random(0, 12)
doSendMagicEffect(getThingPos(cid), 173)
doSendMagicEffect(toPos, 53)
doSummonCreature(d100[random].pokemon, playerpos)
setPlayerStorageValue(cid, 171833, -1)
doPlayerAddSkillTry(cid, 6, 1)
end
end
if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) >= 1 then
doPlayerSendTextMessage(cid, 27, "You can't fish yet.")
return false
end
if(isInArray(config.waters, itemEx.itemid)) and getPlayerStorageValue(cid, 171833) <= 0 then
setPlayerStorageValue(cid, 171833, 1)
doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)
doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)
for i = 1,3 do
addEvent(Effect,750*i,cid)
end
addEvent(Say,3000)
return true
end
return true
end
Editado Janeiro 31 por DidoGunner